package com.hdaccp.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hdaccp.dao.ZongDao;
import com.hdaccp.dao.impl.ZongDaoimpl;

@WebServlet(urlPatterns = "/riqi.so")
public class riqi extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		response.setContentType("text/html;charset=utf-8");
		request.setCharacterEncoding("utf-8");
		int id = Integer.parseInt(request.getParameter("id"));
		update(request, response, id);
	}

	public void update(HttpServletRequest request, HttpServletResponse response, int id)
			throws ServletException, IOException {
		ZongDao zd = new ZongDaoimpl();
		zd.bupdate(id);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		doGet(request, response);

	}

}
